package com.complex.spring.mvc.dal;

public class UserDAOImpl implements UserDAO {
	
	public static UserDO user = new UserDO();
	
	static {
		user.setUserId("uid-1");
		user.setLoginId("ymkyve");
		user.setName("哥的名字叫传说");
		
	}
	/* (non-Javadoc)
	 * @see com.complex.spring.mvc.dal.UserDAO#create(com.complex.spring.mvc.dal.UserDO)
	 */
	public String create(UserDO user){
		return user.getUserId();
	}
	/* (non-Javadoc)
	 * @see com.complex.spring.mvc.dal.UserDAO#getUser()
	 */
	public UserDO getUser(){
		return user;
	}
	
	/* (non-Javadoc)
	 * @see com.complex.spring.mvc.dal.UserDAO#getUserByUserId(java.lang.String)
	 */
	public UserDO getUserByUserId(String userId){
		return user;
	}
	
	/* (non-Javadoc)
	 * @see com.complex.spring.mvc.dal.UserDAO#getUserByLoginId(java.lang.String)
	 */
	public UserDO getUserByLoginId(String loginId){
		return user;
	}
	
	/* (non-Javadoc)
	 * @see com.complex.spring.mvc.dal.UserDAO#update(com.complex.spring.mvc.dal.UserDO)
	 */
	public boolean update(UserDO user){
		this.user = user;
		return true;
	}
	
	/* (non-Javadoc)
	 * @see com.complex.spring.mvc.dal.UserDAO#delete(java.lang.String)
	 */
	public boolean delete(String userId){
		this.user = null;
		return true;
	}
	
}
